﻿using System;
using Framework;

namespace Enterprise.Admin.Handle.Video
{
    public partial class GetDetailJson : AdminBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Fq("id").SafeToInt();
            var videoService = new VideoService();
            var row = videoService.GetById(id);
            object result = new
                                {
                                    CoVideoId = row["CoVideoId"].SafeToString(),
                                    CoName = row["CoName"].SafeToString(),
                                    CoContent = row["CoContent"].SafeToString(),
                                    CoIsRecommend = row["CoIsRecommend"].SafeToBool(),
                                    CoDate = row["CoDate"].SafeToDateTime().ToString("yyyy-MM-dd HH:mm:ss"),
                                    CoSummary = row["CoSummary"].SafeToBool(),
                                    CoIsPopular = row["CoIsRecommend"].SafeToBool(),
                                    CoIsTop = row["CoIsTop"].SafeToBool(),
                                    CoViews = row["CoViews"].SafeToInt(),
                                    CoIsReserved = row["CoLanguage"].SafeToBool(),
                                    CoReservedUrl = row["CoReservedUrl"].SafeToString(),
                                    CoVideoCategoryId = row["CoVideoCategoryId"].SafeToString(),
                                    CoCategoryPath = row["CoCategoryPath"].SafeToString(),
                                    CoLanguage = row["CoLanguage"].SafeToString(),
                                };
            Json(result);
        }
    }
}